package com.eternal.util.enums;

import com.baomidou.mybatisplus.enums.IEnum;
import com.eternal.permission.entity.enums.IsOpenEnum;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;


/**
 * @author Eternal
 * @Title: BaseEnum
 * @ProjectName notest
 * @Description: TODO
 * @date 2018/9/7 15:38
 */
public class BaseEnum<T extends Enum<T> > implements IEnum {

private T t;


     T getEnumByCode(String code) {

         try {
             Method values = t.getClass().getDeclaredMethod("values", null);

             String name = values.getName();

             System.out.println("name:"+name);
         } catch (NoSuchMethodException e) {
             e.printStackTrace();
         }
      /*  for (T ftype : t.values()) {
            if (ftype.code.equals(code)) {xianz
                return ftype;
            }
        }*/

        return null;
    }

 /*     E getEnumByName(String name){
        return null;
    }*/


    @Override
    public Serializable getValue() {
        return null;
    }
}
